Xbasic

{ON_CHAR}

Syntax

{ON_CHAR= Event_Name _*}

Arguments

Event_Name

Character. A value for a_dlg_button that the event handlers in the %code% section to respond to.

Description

The {ON_CHAR} command allows you to capture printable keystrokes. Contrast with {ON_KEY} which lets you trap non-printable keys, such as F2, or PAGE UP, or CTRL END.

Example

dim list as C
ui_dlg_box("{ON_CHAR}",<<%dlg%
{on_char=chr_*}
Type a key. The key you typed is shown here.;
[.40,20^#list];
%dlg%,<<%code%
if left(a_dlg_button,4) = "chr_" then
list = list + crlf()+ substr(a_dlg_button ,5)
list = remove_blank_lines(list)
a_dlg_button = ""
end if
%code%)

Limitations

Desktop applications only

See Also